package com.cy.gameserver;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by tiankai.qin on 17/12/27.
 * <p>
 * 入口启动类放在包的最外层，spring将自动扫描此目录下所有路径，加载bean
 *
 */
@Controller
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@ServletComponentScan
@MapperScan("com.cy.gameserver.dao.mapper")
public class Main {

    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    @RequestMapping("/")
    String index(Model model) {
        logger.info("有访问进来啦！");
        model.addAttribute("name", "QTK");
        return "index";
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(Main.class, args);
    }

}
